import request from '../utils/request'
import * as qs from 'qs'
/**添加电子入库单 */
export const add = (data: AnyObject) => request('/cer/e_receipt/add.do', data)

/**绑定SAP入库单 */
export const bindSAP = (data: AnyObject) => request('/cer/e_receipt/bindSAP.do', data)

/**删除电子入库单 */
export const remove = (data: { ids: string[] }) => request('/cer/e_receipt/delete.do', data)

/**电子入库单详情 */
export const detail = (id: string) => {
    const params = qs.stringify({ id })
    return request('/cer/e_receipt/detail.do?' + params)
}

/**入库提交 */
export const submit = (data: AnyObject) => request('/cer/e_receipt/putInStorage.do', data)

/**扫码保存 */
export const scan = (data: AnyObject) => request('/cer/e_receipt/scanSave.do', data)

/**分页查询电子入库单列表 */
export const list = (data: AnyObject) =>
    request('/cer/e_receipt/search.do', data, 'POST', { hideLoading: true })

/**更新电子入库单 */
export const update = (data: AnyObject) => request('/cer/e_receipt/update.do', data)

/**查询产品code列表 */
export const procuctionList = (data: AnyObject) =>
    request('/cer/e_receipt/productInfoQuery.do', data, 'POST', { hideLoading: true })
